﻿@model IList<Qu.SeniorProject.Model.StudentGrade>


@*@if (ViewBag.StudentGrades != null)
{*@
@*<h3>Please do not announce the project Grades to the students until approval by the Head of Department.</h3>*@

@section head {

	<style type="text/css">
		a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
	</style>

@*    <link href="@Url.Content("~/Content/GradesTable.css")" rel="stylesheet" type="text/css" />*@
    <link href="@Url.Content("~/Content/GradesTable.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/colorbox.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.tablesorter.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.colorbox-min.js")" type="text/javascript"></script>

   <script language="javascript" type="text/javascript">
       $(function () {
           //$("#gradesTable").tablesorter();
           $("a[rel='ProjectGradingDetails']").colorbox({ transition: "fade", width: "90%", height: "90%", current: "Student {current} of {total}", opacity: "0.7" });
       });
   </script>
 }

<h2>Project Grade</h2>
<table class="table">
        <tr>
            <td class="tdProjectSummary">
                ProjectID: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.ProjectID
            </td>
            <td class="tdProjectSummary">
                Project Title: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.Title
            </td>
        </tr>
        <tr>
            <td class="tdProjectSummary">
                Students:
            </td>
            <td class="tdProjectField">
                @Html.Raw(ViewBag.ProjectSummary.Students)
            </td>
            <td class="tdProjectSummary">
                Major: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.Major
            </td>
        </tr>
@*        <tr>
            <td class="tdProjectSummary">
                Supervisors:
            </td>
            <td class="tdProjectField">
                @Html.Raw(ViewBag.ProjectSummary.Supervisors)
            </td>
            <td class="tdProjectSummary">
                Proposal Examiner: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.ProposalExaminer
            </td>
        </tr>*@
</table>
<br />
<br />
<table>
    <tr>
        <th style="width: 350px;">
            StudentName
        </th>
        <th>
            EvaluatedItem
        </th>
        <th>
            By
        </th>
        <th>
            StudentGrade
        </th>
        <th>
            OutOf
        </th>
        <th>
            LetterGrade
        </th>
        <th></th>
@*        <th>
            Weight for Examiner
        </th>*@
@*        <th>
            Comment
        </th>*@
    </tr>
    @{string studentName = string.Empty;
      string examiner = string.Empty;
      string evaluatedItem = string.Empty;
      string linkToGradeDetails = string.Empty;
     }
    @foreach (var sg in Model)
    {
        <tr>
            <td>
                @if (studentName == sg.StudentName)
                {
                    <span></span>
                }
                else
                {
                    <strong>@sg.StudentName</strong><span> (
                    <a href="@Url.Content("~/Grading")/StudentGrades?ProjectID=@sg.ProjectID&StudentID=@sg.StudentId&gradingType=@ViewBag.GradingType&role=@ViewBag.ExaminerRole" rel="ProjectGradingDetails" title="Grading Details for @sg.StudentName (Project#@sg.ProjectID)">Grade Details</a>)</span>
                }
            </td>
            <td>
                @Html.Raw((sg.EvaluatedItem == "Total" ? "<strong>Total</strong>" : (sg.EvaluatedItem == evaluatedItem ? "" : sg.EvaluatedItem)))
            </td>        
            <td>
               @sg.Examiner
            </td>

            <td align="center">
                @sg.Grade
            </td>
            <td>
                @sg.OutOf
            </td>
            <td>
                <strong>@sg.LetterGrade</strong>
            </td>
            <td>
                @sg.Comment
            </td>
@*            <td>
                @sg.Weight
            </td>*@
@*            <td>
                @sg.Comment
            </td>*@
        </tr>
        
        studentName = sg.StudentName;
        examiner = sg.Examiner;
        evaluatedItem = sg.EvaluatedItem;
    }
</table>
<br/><br/><br/>
<a href="#" onClick="history.go(-1); return false;">Back</a>



